#include "thread_pool.h"
#include "user.h"
#include "mysql/mysql.h"
extern ListNode *userList;
void mkdirCommand(task_t * task)
{
    ListNode * p = userList;
    while(p){
        if(p->val->peerfd == task->peerfd && p->val->login_status == LOGIN_ON){
            user_info * user = p->val;
            //从虚拟文件表中获取parent_id
            int parent_id = select_parent_id(user);
            //初始化输入表项内容
            VF_entry entry;
            memset(&entry,0,sizeof(entry));
            entry.parent_id = parent_id;
            strcpy(entry.filename,task->data);
            entry.owner_id = user->user_id;
            strcpy(entry.type,"d");
            strcpy(entry.pwd,user->pwd);
            add_file(&entry,user);
            break;
        }else{
            p = p->next;
        }
    }
}
